# -*- coding: utf-8 -*-

import random


def count_sort(li, max_count=100):
    tmp = [0 for i in range(max_count + 1)]
    result = []
    for index, count in enumerate(li):
        tmp[count] += 1

    for index, count in enumerate(tmp):
        for j in range(count):
            result.append(index)
    li.clear()
    li[0:] = result
    print(li)
count_sort([1,3,5,6,3,4,7,89])